package com.aaa.gs;

import com.aaa.gs.config.RibbonLoadBalanceConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

/**
 * @ FileName: OrderServiceAApp
 * @ Description:
 * @ Author:  STB
 * @ CreateTime: 2025/8/25 0025 16:51
 * @ Version: 1.0.0
 */
@SpringBootApplication
@MapperScan("com.aaa.gs.dao")
@EnableTransactionManagement //开启事务
@EnableDiscoveryClient
@RibbonClient(name = "GoodsServiceAppRibbon",
configuration = RibbonLoadBalanceConfig.class)
@EnableFeignClients
public class GoodsServiceApp {
    public static void main(String[] args)  {

        SpringApplication.run(GoodsServiceApp.class, args);
    }
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}

